Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Binary serialization support was removed in modern .NET. The [Serializable] attribute on TranslatableXmlModel<T> serves no purpose since the class uses XmlSerializer, which doesn't require it.

Changes

  • Removed [Serializable] attribute from TranslatableXmlModel<T> in src/LuYao.Common/Xml/TranslatableXmlModel.cs

The class continues to work identically with XmlSerializer, which uses reflection and XML-specific attributes ([XmlElement], [XmlAttribute], etc.) rather than the binary serialization marker attribute.

Original prompt

This section details on the original issue you should resolve

<issue_title>修正单元测试项目的报错</issue_title>
<issue_description>似乎是二进制序列化被移除,如果确认,你可以删除这个 API 了。</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

The [Serializable] attribute is no longer needed as binary serialization
has been removed in modern .NET versions. This class uses XmlSerializer
which doesn't require the [Serializable] attribute.

All tests pass after this change.

Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix errors in unit test project Remove deprecated [Serializable] attribute from TranslatableXmlModel Jan 16, 2026
Copilot AI requested a review from Soar360 January 16, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

修正单元测试项目的报错

2 participants